Let's add events to move. An event is a block of code that has a specific task and must receive a signal to run.

  • Go to and drag out Left Key and Right Key.
  • Click Run and then press the right and left keys to test your program.

The Left Key event's task is to move the sprite left. It is signaled when the left key is pressed.

The Right Key event's task is to move the sprite right. It is signaled when the right key is pressed.

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_background("schoolhallway") sprite = codesters.Sprite("person8") stage.set_gravity(4) stage.disable_floor() sprite.set_gravity_off() sprite.go_to(0, -220) score = 0 score_board = codesters.Display(score) my_info = ["cellphone", "address", "birthdate"]
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)